package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @ProjectName: AptitudeAndroid
 * @Package: com.cj.mobile.iabp.mvp.model.entity
 * @ClassName: GrantingStores
 * @Description: 合作门店
 * @Author: WLY
 * @CreateDate: 2024/3/13 17:26
 */
public class GrantingStores implements Parcelable {
    public GrantingStores() {
    }

    public GrantingStores(String storeId, String storeName, String operName, double totalAmount, double creditAmount) {
        this.storeId = storeId;
        this.storeName = storeName;
        this.operName = operName;
        this.totalAmount = totalAmount;
        this.creditAmount = creditAmount;
    }

    // 门店ID
    private String storeId;
    // 门店名称
    private String storeName;
    // 法人姓名
    private String operName;
    // 电话
    private String mobilePhone;
    // 信用额度
    private double totalAmount;
    // 已用授信金额
    private double creditAmount;
    // 订单总数
    private int orderCount;
    // 用款记录
    private List<PaymentRecordsInfo> billList;

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getOperName() {
        return operName;
    }

    public void setOperName(String operName) {
        this.operName = operName;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public double getCreditAmount() {
        return creditAmount;
    }

    public void setCreditAmount(double creditAmount) {
        this.creditAmount = creditAmount;
    }

    public int getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(int orderCount) {
        this.orderCount = orderCount;
    }

    public List<PaymentRecordsInfo> getBillList() {
        return billList;
    }

    public void setBillList(List<PaymentRecordsInfo> billList) {
        this.billList = billList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.storeId);
        dest.writeString(this.storeName);
        dest.writeString(this.operName);
        dest.writeString(this.mobilePhone);
        dest.writeDouble(this.totalAmount);
        dest.writeDouble(this.creditAmount);
        dest.writeInt(this.orderCount);
        dest.writeList(this.billList);
    }

    public void readFromParcel(Parcel source) {
        this.storeId = source.readString();
        this.storeName = source.readString();
        this.operName = source.readString();
        this.mobilePhone = source.readString();
        this.totalAmount = source.readDouble();
        this.creditAmount = source.readDouble();
        this.orderCount = source.readInt();
        this.billList = new ArrayList<PaymentRecordsInfo>();
        source.readList(this.billList, PaymentRecordsInfo.class.getClassLoader());
    }

    protected GrantingStores(Parcel in) {
        this.storeId = in.readString();
        this.storeName = in.readString();
        this.operName = in.readString();
        this.mobilePhone = in.readString();
        this.totalAmount = in.readDouble();
        this.creditAmount = in.readDouble();
        this.orderCount = in.readInt();
        this.billList = new ArrayList<PaymentRecordsInfo>();
        in.readList(this.billList, PaymentRecordsInfo.class.getClassLoader());
    }

    public static final Creator<GrantingStores> CREATOR = new Creator<GrantingStores>() {
        @Override
        public GrantingStores createFromParcel(Parcel source) {
            return new GrantingStores(source);
        }

        @Override
        public GrantingStores[] newArray(int size) {
            return new GrantingStores[size];
        }
    };
}
